# -*- coding: UTF-8 -*-
'''
Created on 02/10/2014

@author: Eduardo Cardeira - Num 6033

Exercicios 2 e 4 da Aula 2
'''
import random
import numpy

### Exercicio 2 ###

print type(1), type(3.4), type((3+3j) + 2)
print type('treta'), type(True and False)

a = '1'
b = 'Uma'

print type(a), type(b)
print type([1, 2, 3, [2, 3]]), type((1, 2, 3))

class Teste:
	pass

print type(Teste)

obj = Teste()
print type(obj)

def func():
	return 3
	pass

print type(func)

print type(range(0, 10))
print type(xrange(0, 10))
print type( a > 10 if 10 else 2)
print type(a) == type('string') if 'uma string' else 'nao sei'

print type(b) == type('complex') if (3+3j) + 2 else False

### Exercicio 4 ###

def calcular_variancia(list_of_numbers):
 	return numpy.var(list_of_numbers)
  	pass

random_number_list = random.sample(range(1000000), 100)
print calcular_variancia(random_number_list)
